<!-- inc:frame.top -->

<!-- 模板管理 -->
<!-- if($act=="add" || $act=="modify") -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=upfiles&act=list">文件管理</a> &raquo; <a href="{:$mainlink}?file=mould&act=set">模板管理</a><!-- if($act=="modify") --> &raquo; 当前路径: / {:$temp2} / {:$id}<!-- end --></p><!-- inc:position.fr --></div>

<script type="text/javascript">
function createTextAreaWithLines(id)
{
	var el = document.createElement('DIV');
	var ta = document.getElementById(id);
	ta.parentNode.insertBefore(el,ta);
	el.appendChild(ta);
	el.className='textAreaWithLines';
	ta.style.paddingLeft = '32px';
	el.style.height = (ta.offsetHeight + 2) + 'px';
	el.style.overflow = 'hidden';
	el.style.position = 'relative';
	
	var lineObj = document.createElement('DIV');
	lineObj.style.position = 'absolute';
	lineObj.style.left = '0px';
	lineObj.style.width = '30px';
	el.insertBefore(lineObj,ta);
	lineObj.style.textAlign = 'right';
	lineObj.style.zIndex = '4';
	lineObj.className='lineObj';
	
	var string = '<div class="lineObj_in">';
	for(var no=1;no<1500;no++)
	{
		string = string+"<p>"+no+"</p>";
	}
	string = string+"</div>"
	
	ta.onkeydown = function() { positionLineObj(lineObj,ta); };
	ta.onmousedown = function() { positionLineObj(lineObj,ta); };
	ta.onscroll = function() { positionLineObj(lineObj,ta); };
	ta.onblur = function() { positionLineObj(lineObj,ta); };
	ta.onfocus = function() { positionLineObj(lineObj,ta); };
	ta.onmouseover = function() { positionLineObj(lineObj,ta); };
	lineObj.innerHTML = string;
}
function positionLineObj(obj,ta)
{
      obj.style.top = (ta.scrollTop * -1) + 'px';
}
</script>

<div class="page_pad">
  <form id="mouldform" method="post" action="{:$mainlink}?file=mould&act=setok&temp={:$temp}&id={:$id_}" onsubmit="return mod_msg();">
  <div class="content_box">
    <div class="content_bor">
      <table class="ctable">
        <tr>
          <td class="left">文件代码：</td>
          <td class="right">
            <div id="reset">
              <textarea id="htmlcont" class="gtext_mould" name="htmlcont">{:$str}</textarea>
            </div>
			<script>createTextAreaWithLines('htmlcont'); </script>
          </td>
        </tr>
      </table>
    </div>
  </div><!--content_box-->
  
  <div class="gbutton_div"><button type="submit" class="gbutton gbutton_dblue gbutton_add"><!-- if($act=="add") -->添加模板<!-- else -->编辑模板<!-- end --></button> <button type="button" class="gbutton gbutton_add" onclick="qgurl('{:$mainlink}?file=mould&act=set&temp={:$temp}')">返回</button></div>
  </form>
</div><!--page_pad-->

<!-- else -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=upfiles&act=list">文件管理</a> &raquo; <a href="{:$mainlink}?file=mould&act=set">模板管理</a> &raquo; 当前路径: / {:$temp2}</p><!-- inc:position.fr --></div>

<div class="page_pad">
  <div class="content_add"><button class="gbutton gbutton_dblue gbutton_add" type="button" onclick="qgurl('{:$mainlink}?file=mould&act=set{:$prevurl}')">返回上一级</button></div>
  
  <div class="content_box">
    <div class="content_bor">
      <table class="ltable">
        <tr class="first">
          <td>排序</td>
          <td align="left"><!-- if($temp) -->模板<!-- else -->目录<!-- end --></td>
          <td width="220">操作</td>
        </tr>
        <!-- $msglist AS $key=>$value -->
        <!-- if($value[isdir]==1) -->
        <tr>
          <td width="200">{:$value[row_index]}</td>
          <td align="left"><a href="{:$mainlink}?file=mould&act=set&temp={if($temp)}{:$temp}__{end}{:$value[name]}"><span style="position:relative; top:2px"><img src="images/folder.gif" /></span>{:$value[name]}</a></td>
          <td><button class="gbutton" type="button" onclick="qgurl('{:$mainlink}?file=mould&act=set&temp={if($temp)}{:$temp}__{end}{:$value[name]}')">编辑</button></td>
        </tr>
        <!-- else -->
        <tr>
          <td width="200">{:$value[row_index]}</td>
          <td align="left"><a href="{:$mainlink}?file=mould&act=modify&id={:$value[namec]}&temp={:$temp}">&nbsp;<span style="position:relative; top:2px"><img src="images/file.gif" /></span>{:$value[name]}</a></td>
          <td>
            <button class="gbutton" type="button" onclick="qg_modify('{:$value[namec]}&temp={:$temp}')">编辑</button>
            <button class="gbutton" type="button" onclick="qg_delete('{:$value[namec]}&temp={:$temp}')">删除</button>
          </td>
        </tr>
        <!-- end -->
        <!-- end -->
      </table>
    </div>
  </div><!--content_box-->
</div><!--page_pad-->

<script type="text/javascript">
function qg_modify(id)
{
	qgurl("{:$mainlink}?file=mould&act=modify&id="+id);
}
function qg_delete(id)
{
	//判断是否删除
	url = "{:$mainlink}?file=mould&act=delete&id="+id;
	tip_confirm("确认删除该信息吗？特别说明，删除后无法恢复！",url);
}
</script>
<!-- end -->

<!-- inc:frame.bottom -->